package com.wt.admin.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
public class SocketVO<T> implements Cloneable {
    private String type;
    private T data;

    @Override
    public SocketVO<T> clone() {
        try {
            return (SocketVO<T>) super.clone();
        } catch (Exception e) {
            return new SocketVO<T>();
        }
    }

    public SocketVO<T> build(String type, T data) {
        SocketVO<T> clone = this.clone();
        clone.setData(data);
        clone.setType(type);
        return clone;
    }


}